<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: gbdk-lib/include/gb/cgb.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GBDK 2020 Docs
   &#160;<span id="projectnumber">4.4.0</span>
   </div>
   <div id="projectbrief">API Documentation for GBDK 2020</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('cgb_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">cgb.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="cgb_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#ifndef _CGB_H</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#define _CGB_H</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;types.h&gt;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="stdint_8h.html">stdint.h</a>&gt;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="cgb_8h.html#a4a118ad3ee36468a3fa616977a64864e">   33</a></span>&#160;<span class="preprocessor">#define RGB(r, g, b) ((uint16_t)((((b) &amp; 0x1f) &lt;&lt; 10) | ((uint16_t)(((g) &amp; 0x1f) &lt;&lt; 5)) | ((r) &amp; 0x1f)))</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="cgb_8h.html#a7d2ed0f10b2b74123a544327bbfd7564">   47</a></span>&#160;<span class="preprocessor">#define RGB8(r, g, b) (((uint16_t)((((b) &gt;&gt; 3) &amp; 0x1f) &lt;&lt; 10)) | ((uint16_t)((((g) &gt;&gt; 3) &amp; 0x1f) &lt;&lt; 5)) | (((r) &gt;&gt; 3) &amp; 0x1f))</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160; </div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="cgb_8h.html#ab5a6e450fcf10402278fe585a421dbbd">   59</a></span>&#160;<span class="preprocessor">#define RGBHTML(RGB24bit) (RGB8((((RGB24bit) &gt;&gt; 16) &amp; 0xff), (((RGB24bit) &gt;&gt; 8) &amp; 0xff), ((RGB24bit) &amp; 0xff)))</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160; </div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="cgb_8h.html#aa039288455af8a3812a35aa1e7b903e4">   63</a></span>&#160;<span class="preprocessor">#define RGB_RED        RGB(31,  0,  0)</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="cgb_8h.html#ae29b6947ac7dca7db513e59f1cfcbf51">   64</a></span>&#160;<span class="preprocessor">#define RGB_DARKRED    RGB(15,  0,  0)</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="cgb_8h.html#ab6c97468034c02fe204fd37036d9be15">   65</a></span>&#160;<span class="preprocessor">#define RGB_GREEN      RGB( 0, 31,  0)</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="cgb_8h.html#a1ee7a5d8fd635e9132a2820a60f9789d">   66</a></span>&#160;<span class="preprocessor">#define RGB_DARKGREEN  RGB( 0, 15,  0)</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="cgb_8h.html#a0eff802f1ca228046476209dc01c76ad">   67</a></span>&#160;<span class="preprocessor">#define RGB_BLUE       RGB( 0,  0, 31)</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="cgb_8h.html#ad44385fc245bbabf6da787dcc8930385">   68</a></span>&#160;<span class="preprocessor">#define RGB_DARKBLUE   RGB( 0,  0, 15)</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="cgb_8h.html#ad74a18fca945f257dc9d1b99f9edbd40">   69</a></span>&#160;<span class="preprocessor">#define RGB_YELLOW     RGB(31, 31,  0)</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="cgb_8h.html#a2727da9f8c0b09a67375575a00186e2a">   70</a></span>&#160;<span class="preprocessor">#define RGB_DARKYELLOW RGB(21, 21,  0)</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="cgb_8h.html#a2ce30ac984869b55594447722b9d0579">   71</a></span>&#160;<span class="preprocessor">#define RGB_CYAN       RGB( 0, 31, 31)</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="cgb_8h.html#ae4fe0c6cfa46b0c4804425f23bb48f4c">   72</a></span>&#160;<span class="preprocessor">#define RGB_AQUA       RGB(28,  5, 22)</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="cgb_8h.html#a59fb596d3d65cfc4d3cb7e5044b8b10a">   73</a></span>&#160;<span class="preprocessor">#define RGB_PINK       RGB(31,  0, 31)</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="cgb_8h.html#a9d5a5f880df6bd4b64e6546839d41101">   74</a></span>&#160;<span class="preprocessor">#define RGB_PURPLE     RGB(21,  0, 21)</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="cgb_8h.html#ae168f0f9864d4ed4be7807b9783f17f1">   75</a></span>&#160;<span class="preprocessor">#define RGB_BLACK      RGB( 0,  0,  0)</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="cgb_8h.html#a29b47e2361025eabcdc3bcbff2308044">   76</a></span>&#160;<span class="preprocessor">#define RGB_DARKGRAY   RGB(10, 10, 10)</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="cgb_8h.html#a80efbf7b13421922fb174f3e6a3e235c">   77</a></span>&#160;<span class="preprocessor">#define RGB_LIGHTGRAY  RGB(21, 21, 21)</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="cgb_8h.html#ac1771f95d9887118764bd8a074e537e1">   78</a></span>&#160;<span class="preprocessor">#define RGB_WHITE      RGB(31, 31, 31)</span></div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160; </div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="cgb_8h.html#a90ef6e9a3d95516b1fef15076b1b4999">   80</a></span>&#160;<span class="preprocessor">#define RGB_LIGHTFLESH RGB(30, 20, 15)</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="cgb_8h.html#a7c2a437dfb89d663a1c2f0a7a9256474">   81</a></span>&#160;<span class="preprocessor">#define RGB_BROWN      RGB(10, 10,  0)</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="cgb_8h.html#a0a85d8d0da8edc5cce98f48701f903f7">   82</a></span>&#160;<span class="preprocessor">#define RGB_ORANGE     RGB(30, 20,  0)</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="cgb_8h.html#a9c8c3710151b2258ea8269850498703f">   83</a></span>&#160;<span class="preprocessor">#define RGB_TEAL       RGB(15, 15,  0)</span></div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">   85</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a> <a class="code" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a>;   </div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="cgb_8h.html#a11902cb1c4de48a1992f5cd595c1da38">  104</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#a11902cb1c4de48a1992f5cd595c1da38">set_bkg_palette</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> first_palette, <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> nb_palettes, <span class="keyword">const</span> <a class="code" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a> *rgb_data) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160; </div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="cgb_8h.html#a70244637bddfbb327c9684455fa8ffa6">  123</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#a70244637bddfbb327c9684455fa8ffa6">set_sprite_palette</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> first_palette, <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> nb_palettes, <span class="keyword">const</span> <a class="code" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a> *rgb_data) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160; </div>
<div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="cgb_8h.html#aa8881ff123f364f2e7d1e88c18f9fbca">  136</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#aa8881ff123f364f2e7d1e88c18f9fbca">set_bkg_palette_entry</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> palette, <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> entry, <a class="code" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a> rgb_data) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160; </div>
<div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="cgb_8h.html#aebeb7431ebd400baed34796a8f50ea58">  148</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#aebeb7431ebd400baed34796a8f50ea58">set_sprite_palette_entry</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> palette, <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> entry, <a class="code" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a> rgb_data) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160; </div>
<div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="cgb_8h.html#a476d06d0fe64d7c5a1ec05b8ee859a56">  160</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#a476d06d0fe64d7c5a1ec05b8ee859a56">cpu_slow</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160; </div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;<span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#a871b5b1aba74ab8764f72b73bc090adb">cpu_fast</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"><a class="line" href="cgb_8h.html#a2a89f4110072dbe76805e7b07299788d">  184</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#a2a89f4110072dbe76805e7b07299788d">set_default_palette</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160; </div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;<span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#a6b334e5e452d0650aded17199be1514a">cgb_compatibility</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160; </div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* _CGB_H */</span><span class="preprocessor"></span></div>
<div class="ttc" id="aasm_2types_8h_html_a0971918860055db2e50dacea4da8f3bc"><div class="ttname"><a href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a></div><div class="ttdeci">#define OLDCALL</div><div class="ttdef"><b>Definition:</b> types.h:21</div></div>
<div class="ttc" id="acgb_8h_html_a11902cb1c4de48a1992f5cd595c1da38"><div class="ttname"><a href="cgb_8h.html#a11902cb1c4de48a1992f5cd595c1da38">set_bkg_palette</a></div><div class="ttdeci">void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) OLDCALL</div></div>
<div class="ttc" id="acgb_8h_html_a2a89f4110072dbe76805e7b07299788d"><div class="ttname"><a href="cgb_8h.html#a2a89f4110072dbe76805e7b07299788d">set_default_palette</a></div><div class="ttdeci">void set_default_palette(void)</div></div>
<div class="ttc" id="acgb_8h_html_a476d06d0fe64d7c5a1ec05b8ee859a56"><div class="ttname"><a href="cgb_8h.html#a476d06d0fe64d7c5a1ec05b8ee859a56">cpu_slow</a></div><div class="ttdeci">void cpu_slow(void)</div></div>
<div class="ttc" id="acgb_8h_html_a6b334e5e452d0650aded17199be1514a"><div class="ttname"><a href="cgb_8h.html#a6b334e5e452d0650aded17199be1514a">cgb_compatibility</a></div><div class="ttdeci">void cgb_compatibility(void)</div><div class="ttdef"><b>Definition:</b> sms.h:588</div></div>
<div class="ttc" id="acgb_8h_html_a70244637bddfbb327c9684455fa8ffa6"><div class="ttname"><a href="cgb_8h.html#a70244637bddfbb327c9684455fa8ffa6">set_sprite_palette</a></div><div class="ttdeci">void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) OLDCALL</div></div>
<div class="ttc" id="acgb_8h_html_a871b5b1aba74ab8764f72b73bc090adb"><div class="ttname"><a href="cgb_8h.html#a871b5b1aba74ab8764f72b73bc090adb">cpu_fast</a></div><div class="ttdeci">void cpu_fast(void)</div><div class="ttdef"><b>Definition:</b> msx.h:551</div></div>
<div class="ttc" id="acgb_8h_html_aa8881ff123f364f2e7d1e88c18f9fbca"><div class="ttname"><a href="cgb_8h.html#aa8881ff123f364f2e7d1e88c18f9fbca">set_bkg_palette_entry</a></div><div class="ttdeci">void set_bkg_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL</div></div>
<div class="ttc" id="acgb_8h_html_aebeb7431ebd400baed34796a8f50ea58"><div class="ttname"><a href="cgb_8h.html#aebeb7431ebd400baed34796a8f50ea58">set_sprite_palette_entry</a></div><div class="ttdeci">void set_sprite_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL</div></div>
<div class="ttc" id="acgb_8h_html_af868d7cdbd052c6b972ef137e02f6495"><div class="ttname"><a href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a></div><div class="ttdeci">uint16_t palette_color_t</div><div class="ttdef"><b>Definition:</b> cgb.h:85</div></div>
<div class="ttc" id="astdint_8h_html"><div class="ttname"><a href="stdint_8h.html">stdint.h</a></div></div>
<div class="ttc" id="astdint_8h_html_aba7bc1797add20fe3efdf37ced1182c5"><div class="ttname"><a href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a></div><div class="ttdeci">unsigned char uint8_t</div><div class="ttdef"><b>Definition:</b> stdint.h:51</div></div>
<div class="ttc" id="astdint_8h_html_adf4d876453337156dde61095e1f20223"><div class="ttname"><a href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a></div><div class="ttdeci">unsigned short int uint16_t</div><div class="ttdef"><b>Definition:</b> stdint.h:52</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
</div>
</body>
</html>
